package model;

/**
 * Data-class, contains data and relevant methods.
 * @author Group 20
 *
 */
public class Konto 
{
	private int saldo = 0;
	
	/**
	 * sets the saldo to match the balance.
	 * @param balance: player balance.
	 */
	public Konto(int balance)
	{
		this.saldo = balance;
	}
	
	/**
	 * deposits an amount equal to the variable amount.
	 * @param amount: amount value
	 */
	public void deposit(int amount)
	{
		saldo += amount;
	}
	
	/**
	 * Withdraws an amount equal to the variable amount.
	 * @param amount: amount value
	 */
	public void withdraw(int amount)
	{
		saldo -= amount;
	}
	
	/**
	 * getter, returns saldo.
	 * @return saldo: saldo-value
	 */
	public int getBalance()
	{
		return saldo;
	}
	
	/**
	 * setter, sets saldo.
	 * @param newSaldo: value for new saldo
	 */
	public void setSaldo(int newSaldo)
	{
		this.saldo = newSaldo;
	}

	/**
	 * To string method.
	 */
	@Override
	public String toString() {
		return "Konto [saldo=" + saldo + "]";
	}
}
